﻿<UserControl x:Class="Calculator.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1366">

    <Grid x:Name="LayoutRoot" Background="#FF0C0C0C">
        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" x:Name="_error" Text=" "/>
            
            <Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5" BorderBrush="White" BorderThickness="2" Margin="3,3,3,3">
                <TextBlock x:Name="_currentValue" Text="0" FontSize="40" TextAlignment="Right" Margin="3,3,3,3"/>
            </Border>

            <Button Grid.Row="3" Grid.Column="0" Content="7" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="3" Grid.Column="1" Content="8" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="3" Grid.Column="2" Content="9" Click="CalcButtonClick" Padding="15"/>

            <Button Grid.Row="4" Grid.Column="0" Content="4" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="4" Grid.Column="1" Content="5" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="4" Grid.Column="2" Content="6" Click="CalcButtonClick" Padding="15"/>

            <Button Grid.Row="5" Grid.Column="0" Content="1" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="5" Grid.Column="1" Content="2" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="5" Grid.Column="2" Content="3" Click="CalcButtonClick" Padding="15"/>

            <Button Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Content="0" Click="CalcButtonClick" Padding="15"/>

            <Button Grid.Row="6" Grid.Column="2" Content="." Click="CalcButtonClick" Padding="15"/>

            <Button Grid.Row="3" Grid.Column="3" Content="/" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="4" Grid.Column="3" Content="*" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="5" Grid.Column="3" Content="-" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="6" Grid.Column="3" Content="+" Click="CalcButtonClick" Padding="15"/>

            <Button Grid.Row="2" Grid.Column="0" Content="&lt;-" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="2" Grid.Column="1" Content="CE" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="2" Grid.Column="2" Content="C" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="2" Grid.Column="3" Content="+/-" Click="CalcButtonClick" Padding="15"/>

            <Button Grid.Row="4" Grid.Column="4" Content="1/x" Click="CalcButtonClick" Padding="15"/>
            <Button Grid.Row="5" Grid.Column="4" Grid.RowSpan="2" Content="=" Click="CalcButtonClick" Padding="15"/>
        </Grid>
    </Grid>
</UserControl>